uniqueid2 2.2.0
Loading...
Searching...
No Matches
UNIQUE ID 2 Click Driver

API for configuring and manipulating UNIQUE ID 2 Click driver. More...

Topics

 UNIQUE ID 2 Registers List
 List of registers of UNIQUE ID 2 Click driver.
 UNIQUE ID 2 Registers Settings
 Settings for registers of UNIQUE ID 2 Click driver.
 UNIQUE ID 2 MikroBUS Map
 MikroBUS pin mapping of UNIQUE ID 2 Click driver.

Functions

void uniqueid2_cfg_setup (uniqueid2_cfg_t *cfg)
 UNIQUE ID 2 configuration object setup function.
err_t uniqueid2_init (uniqueid2_t *ctx, uniqueid2_cfg_t *cfg)
 UNIQUE ID 2 initialization function.
err_t uniqueid2_default_cfg (uniqueid2_t *ctx)
 UNIQUE ID 2 default configuration function.
err_t uniqueid2_write_memory (uniqueid2_t *ctx, uint32_t address, uint8_t *data_in, uint16_t len)
 UNIQUE ID 2 write memory function.
err_t uniqueid2_read_memory (uniqueid2_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len)
 UNIQUE ID 2 read memory function.
err_t uniqueid2_write_register (uniqueid2_t *ctx, uint8_t reg, uint8_t data_in)
 UNIQUE ID 2 write register function.
err_t uniqueid2_read_register (uniqueid2_t *ctx, uint8_t reg, uint8_t *data_out)
 UNIQUE ID 2 read register function.
err_t uniqueid2_read_id_page (uniqueid2_t *ctx, uint8_t offset, uint8_t *data_out, uint16_t len)
 UNIQUE ID 2 read ID page function.
err_t uniqueid2_read_uid (uniqueid2_t *ctx, uint8_t *uid)
 UNIQUE ID 2 read UID function.
void uniqueid2_set_wc_pin (uniqueid2_t *ctx, uint8_t state)
 UNIQUE ID 2 set WC pin function.

Detailed Description

API for configuring and manipulating UNIQUE ID 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ uniqueid2_cfg_setup()

void uniqueid2_cfg_setup ( uniqueid2_cfg_t * cfg)

UNIQUE ID 2 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See uniqueid2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ uniqueid2_default_cfg()

err_t uniqueid2_default_cfg ( uniqueid2_t * ctx)

UNIQUE ID 2 default configuration function.

This function executes a default configuration of UNIQUE ID 2 Click board.

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ uniqueid2_init()

err_t uniqueid2_init ( uniqueid2_t * ctx,
uniqueid2_cfg_t * cfg )

UNIQUE ID 2 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See uniqueid2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uniqueid2_read_id_page()

err_t uniqueid2_read_id_page ( uniqueid2_t * ctx,
uint8_t offset,
uint8_t * data_out,
uint16_t len )

UNIQUE ID 2 read ID page function.

This function reads a desired number of data bytes from the identification page starting from the selected byte offset.

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[in]offset: Byte offset within the identification page [0x00-0xFF].
[out]data_out: Pointer to the buffer to store read data.
[in]len: Number of bytes to read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uniqueid2_read_memory()

err_t uniqueid2_read_memory ( uniqueid2_t * ctx,
uint32_t address,
uint8_t * data_out,
uint32_t len )

UNIQUE ID 2 read memory function.

This function reads a desired number of data bytes from the EEPROM memory array starting from the selected address.

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[in]address: Start address in memory [0x00000-0x3FFFF].
[out]data_out: Pointer to the buffer to store read data.
[in]len: Number of bytes to read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uniqueid2_read_register()

err_t uniqueid2_read_register ( uniqueid2_t * ctx,
uint8_t reg,
uint8_t * data_out )

UNIQUE ID 2 read register function.

This function reads the selected configuration register (DTI, CDA, or SWP).

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[in]reg: Register selector.
[out]data_out: Pointer to the byte to store the register content.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uniqueid2_read_uid()

err_t uniqueid2_read_uid ( uniqueid2_t * ctx,
uint8_t * uid )

UNIQUE ID 2 read UID function.

This function reads the 16-byte unique identifier from the identification page.

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[out]uid: Pointer to the buffer to store the UID.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uniqueid2_set_wc_pin()

void uniqueid2_set_wc_pin ( uniqueid2_t * ctx,
uint8_t state )

UNIQUE ID 2 set WC pin function.

This function sets the logic state of the write control pin.

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[in]state: Write control pin logic state.
Returns
Nothing.
Note
None.

◆ uniqueid2_write_memory()

err_t uniqueid2_write_memory ( uniqueid2_t * ctx,
uint32_t address,
uint8_t * data_in,
uint16_t len )

UNIQUE ID 2 write memory function.

This function writes a desired number of data bytes to the EEPROM memory array starting from the selected address.

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[in]address: Start address in memory [0x00000-0x3FFFF].
[in]data_in: Pointer to the data to be written.
[in]len: Number of bytes to write (up to one page, 256 bytes).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ uniqueid2_write_register()

err_t uniqueid2_write_register ( uniqueid2_t * ctx,
uint8_t reg,
uint8_t data_in )

UNIQUE ID 2 write register function.

This function writes a single byte to the selected configuration register (CDA or SWP).

Parameters
[in]ctx: Click context object. See uniqueid2_t object definition for detailed explanation.
[in]reg: Register selector.
[in]data_in: Byte to be written to the register.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
Setting the DAL bit (CDA) or the WPL bit (SWP) from 0 to 1 is a permanent, irreversible action that freezes the respective register in read-only mode.